<?php require_once(dirname(__FILE__).'/inc/config.inc.php');IsModelPriv('admin'); ?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>添加系统变量</title>
<link href="templates/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="templates/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="plugin/layer/layer.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/jquery.nicescroll.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/layindex.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/common.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/Validform_v5.3.2_min.js"></script>


<script type="text/javascript">
    $(function () {
        //初始化表单验证
        $("#form").initValidform();
    });
</script>
</head>
<body class="mainbody">
<form method="post" id="form" action="config_var_save.php" >
<!--导航栏-->
<div class="location">
  <a href="config_var.php" class="back"><i></i><span>返回列表页</span></a>
  <a href="home.php" class="home"><i></i><span>首页</span></a>
  <i class="arrow"></i>
  <a href="config_var.php"><span>管理系统变量</span></a>
  <i class="arrow"></i>
  <span>添加系统变量</span>
      <a href="javascript:location.reload();" class="reload">刷新</a>
</div>
<div class="line10"></div>
<!--/导航栏-->

<!--内容-->
<div id="floatHead" class="content-tab-wrap">
  <div class="content-tab">
    <div class="content-tab-ul-wrap">
      <ul>
        <li><a class="selected" href="javascript:;">添加系统变量</a></li>
      </ul>
    </div>
  </div>
</div>

<div class="tab-content">
    <dl>
    <dt>所属组</dt>
    <dd>
      <div class="rule-single-select">
 <select name="vargroup" id="vargroup" datatype="*" errormsg="请选择组" sucmsg=" ">
	 <option value="">请选择组</option>
			  <?php
	  //设置选项卡项
		$config_tab_arr = array('基本设置','附件设置','性能设置','URL静态化','核心设置');
		//统计当前数组数量
		$config_tab_num = count($config_tab_arr);

		foreach($config_tab_arr as $config_tab_id=>$config_tab_text)
		{
			echo '<option value="'.$config_tab_id.'">'.$config_tab_text.'</option>';	
		}
		?>
</select>
      </div>
    </dd>
  </dl>
  
  <dl>
    <dt>变量名称</dt>
    <dd><input  name="varname"  type="text" datatype="/^[A-Za-z_]+$/" errormsg="只能[A-Za-z_]组成" class="input"/> <span class="Validform_checktip">*系统会自动为变量添加 '$cfg_' 前缀</span></dd>
  </dl> 
  <dl>
    <dt>中文名称</dt>
	<dd><input name="varinfo" type="text" id="varinfo" class="input " datatype="*" sucmsg=" " value="" /> <span class="Validform_checktip">变量的中文名称</span></dd>
  </dl>
  <dl>
    <dt>变量值</dt>
  <dd><input name="varvalue" type="text" id="varvalue" class="input normal"  sucmsg=" " value="" /> </dd>
  </dl> 
   <dl>
    <dt>参数提示</dt>
    <dd><input type="text" name="vardesc" id="vardesc" class="input normal" value="" /><span class="Validform_checktip">*输入框右边提示语</span></dd>
  </dl>
  <dl>
    <dt>校检正则</dt>
    <dd><input name="varcheck" type="text" value="" id="varcheck" class="input normal" /><span class="Validform_checktip">*变量需要校检的正则</span></dd>
  </dl>
  <dl>
    <dt>变量类型</dt>
    <dd>
<div class="rule-multi-radio multi-radio">
					<input type="radio" id="vartype_1" name="vartype" value="string" checked="checked" />
					<label for="vartype_1">文本</label>
					<input  id="vartype_2"type="radio" name="vartype"  value="number" />
					<label for="vartype_2">数字</label>
					<input id="vartype_3"type="radio" name="vartype" value="bool" />
					<label for="vartype_3">布尔(Y/N)</label>
					<input id="vartype_3"type="radio" name="vartype" value="bstring" />
					 <label for="vartype_3">多行文本</label><span class="Validform_checktip">*变量需要校检的正则</span>
					</div>
					</dd>
  </dl>

  <dl>
    <dt>是否启用</dt>
    <dd>
      <div class="rule-single-checkbox">
          <input id="checkinfo" type="checkbox" name="checkinfo" value="true" checked="checked"/>
      </div>
      <span class="Validform_checktip">*不启用则无法使用该变量</span>
    </dd>
  </dl>
  
</div>
<!--/内容-->

<!--工具栏-->
<div class="page-footer">
  <div class="btn-wrap">
    <input type="submit" name="btnSubmit" value="提交保存" class="btn" />
    <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript:history.back(-1);" />
	<input type="hidden" name="action" id="action" value="add" />
  </div>
</div>
<!--/工具栏-->
</form>
</body>
</html>
